<?php 
if (strlen(session_id()) < 1) {
    session_start();
}
?>
<!DOCTYPE html>
<html lang="id">
<html>
<head>
	<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
	<title>Pobunesia - Potret Buram Indonesia</title>
	<link rel="stylesheet" type="text/css" href="css/style.css">
	<script type="text/javascript" src="js/custom.js"></script>
    <link rel="icon" href="img/favicon.png" type="image/png" >
</head>
<body>
	<div id="header">
		<a href="index.php"><div id="logo"></div></a>
		<div id="nav">
			<ul>
				<li><a href="index.php">Home</a></li>
				<li><a href="list.php?page=1&tag=nofilter">All List</a></li>
				<?php //if(isset($_SESSION['login_username'])) {?>
                <li><a href="posting.php">Posting</a></li>
                <?php //} ?>
				<li><a href="#" onclick="togglesearch();">Search</a></li>
			</ul>		
		</div>
		<div id="advancedsearch">
			<form id="searchform" action="result.php" method="get">
				Cari 
				<select id="searchoption" onchange="togglesearchoption();">
					<option value="all">Semua</option>
					<option value="username">Username</option>
					<option value="content">Konten</option>
				</select>				
				<input type="text" name="query_username" id="query_username" placeholder="username" size="13">
				<input type="text" name="query_title" id="query_title" placeholder="title" size="13">
				<input type="text" name="query_tag" id="query_tag" placeholder="tag" size="13">
				<input type="submit" value="Search" id="search_button" style="height: 26px; width: 75px;"></div>
			</form>
		</div>
		<?php if(!isset($_SESSION['login_username'])){?>
		<div id="login">
			<a href="register.php">Register</a><form id="loginform"> | Login				
				<input type="text" name="login_username" id="login_username" placeholder="username" size="18" onkeydown="enter_checkLogin(event)">
				<input type="password" name="login_password" id="login_password" placeholder="password" size="18" onkeydown="enter_checkLogin(event)">
				<button type="button" onclick="checkLogin()" style="height: 26px; width: 75px;">Login</button>
			</form>
		<div id="loginrespond"></div>
		</div>
		<?php } else {?>
			<div id="user">
				<div id="userinfo">
					<img src="<?php echo 'user_avatar/'.$_SESSION['login_avatar'];?>" alt="avatar" height="40px" width="40px">
					<div id="userinfo_name">Howdy, <a href="<?php echo 'user.php?username='.$_SESSION['login_username'];?>"><?php echo $_SESSION['login_username'];?></a>!</div>
					<div id="userinfo_logout"><a href="#" onclick="toggleachievement();">Achievements</a>   |   <a href="logout.php">Logout</a></div>
				</div>
				<div id="userachievement">
					<ul>
						<li>New Contributor</li>
						<li>Contributor</li>
						<li>New Commentator</li>
						<li>Commentator</li>
						<li>Good Contributor</li>
						<li>Bad Contributor</li>
					</ul>
				</div>
			</div>
		<?php } ?>
	</div>
